//
//  SearchSingerTableCell.m
//  Coco_Music
//
//  Created by 强哥 on 15/6/24.
//  Copyright (c) 2015年 寇广超. All rights reserved.
//

#import "SearchSingerTableCell.h"
#import "Search.h"

@implementation SearchSingerTableCell

-(void)dealloc
{
    [self.searchInfo release];
    [self.SongLabel release];
    [self.SingerLabel release];
    [self.pick_count release];
    [self.ImageLine release];
    [super dealloc];
    
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creation];
    }
    return self;
}
//单曲自定义cell(singer与single替换了)
-(void)creation
{
 
    UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(self.frame.origin.x+20, self.frame.origin.y+20, [UIScreen mainScreen].bounds.size.width/8, [UIScreen mainScreen].bounds.size.width/8)];
    image.image = [UIImage imageNamed:@"dts_accessory_over_ear_chosen"];
    
    self.SongLabel = [[UILabel alloc]initWithFrame:CGRectMake(image.frame.size.width+50, 15, 250, 30)];
    self.SongLabel.font =[UIFont fontWithName:@"Menlo-Bold" size:18];
    self.SingerLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.SongLabel.frame.origin.x, self.SongLabel.frame.origin.y+30, 250, 30)];
    self.SingerLabel.textColor = [UIColor lightGrayColor];
    
    self.ImageLine = [[UIImageView alloc]initWithFrame:CGRectMake(image.frame.size.width+30, image.frame.size.height+30, [UIScreen mainScreen].bounds.size.width-image.frame.size.width-40, 1)];
    
    _ImageLine.backgroundColor = [UIColor lightGrayColor];
    
    [self.contentView addSubview:_ImageLine];
    [self.contentView addSubview:image];
    [self.contentView addSubview:_SongLabel];
    [self.contentView addSubview:_SingerLabel];
    [_SongLabel release];
    [_SingerLabel release];
    [self.ImageLine release];
}

-(void)setSearchInfo:(Search *)searchInfo
{
    if (_searchInfo != searchInfo) {
        [_searchInfo release];
        _searchInfo = [searchInfo retain];
    }
    self.SingerLabel.text = searchInfo.singer_name;
    self.SongLabel.text = searchInfo.song_name;
    
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
